package com.manbu.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @description:
 * @author: wanghan
 * @time: 2021/4/19 下午11:55
 */
@Configuration
public class ConfigBean {
    //@Configuration 相当于spring 里面的 applicationContext. xml
    @Bean
    /*配置负载均衡 实现RestTemplate Ribbon*/
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
    /*配置负载均衡 实现RestTemplate*/
    //修改 ribbon 负载均衡改为权重

}
